package com.grace.dao;

import com.grace.beans.PageQuery;
import com.grace.model.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);

    //新编写的方法 2019-12-18晚
    SysUser findByKeyword(@Param("keyword") String keyword);

    //排除数据库存在相同的mail
    int countByMail(@Param("email") String email, @Param("id") Integer id);

    //排除数据库存在相同的telephone
    int countByTelephone(@Param("telephone") String telephone, @Param("id") Integer id);

    //计算总条数
    int countByDeptId(@Param("deptId") int deptId);

    //查询实际结果
    List<SysUser> getPageByDeptId(@Param("deptId") int deptId, @Param("page") PageQuery pageQuery);

    //根据IdList获得用户列表
    List<SysUser> getUserListByIdList(@Param("idList") List<Integer> idList);

    //获取所有用户信息
    List<SysUser> getAll();

}